package com.dc.service.impl;

import com.dc.base.model.BaseModel;
import com.dc.service.MessageService;
import com.dc.dao.MessageDao;
import com.dc.dao.impl.MessageDaoImpl;
import java.util.List;

public class MessageServiceImpl implements MessageService {

    MessageDao messageDao = new MessageDaoImpl();
    @Override
    public BaseModel addMessage(Object[] params) throws Exception {
        return null;
    }

    @Override
    public BaseModel updateMessage(Object[] params) throws Exception {
        return null;
    }

    @Override
    public BaseModel deleteMessage(int id) throws Exception {
        return null;
    }

    @Override
    public BaseModel selectMessage(Object[] params) throws Exception {
        BaseModel baseModel=new BaseModel();
        String sql="select * from t_message a join t_user b on a.user_id=b.user_id";
        List lists=messageDao.selectMessage(sql,null);
        baseModel.setCode(1);
        baseModel.setMessage("查询成功");
        baseModel.setData(lists);
        return baseModel;
    }





    @Override
    public BaseModel selectMessageid(int id) throws Exception {
        BaseModel baseModel=new BaseModel();
        String sql="select * from t_message  where message_id="+id+"";
        List lists=messageDao.selectMessageid(sql);
        baseModel.setCode(1);
        baseModel.setMessage("查询成功");
        baseModel.setData(lists);
        return baseModel;

    }
}
